{% load facebook_tags %}
<script type="text/javascript" charset="utf-8">
  function invitePopup() {
    var fbml = '{% filter js_string %}
    <fb:fbml>
        <fb:request-form
            action="{% firstof action_url "'+window.location.href+'" %}"
            method="POST"
            invite="true"
            type="{{ site.name }}"
            content="{{ content }}">
            <fb:multi-friend-selector
                actiontext="Invite your friends to join {{ site.name }}!"
                exclude_ids="{{ exclude_ids }}"
                bypass="cancel"
                rows="3">
        </fb:request-form>
    </fb:fbml>{% endfilter %}';
    var d = new FB.UI.FBMLPopupDialog('Invite your friends',fbml);
    d.setContentHeight(425);
    d.setContentWidth(490);
    d.show();
    return false;
  }
</script>
{% if show_link %}
<a href="#" onclick="return invitePopup();" class="facebook">Invite your Facebook friends to join {{ site.name }}</a>
{% endif %}